From: Jonas Dreßler Date: Sat, 21 Nov 2020 23:10:56 +0000 (+0100) Subject: workspace: Handle child not being present in the window slots array X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~728 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a314c05fec3de0472341991e1ef5190e086643fc;p=gnome-shell.git workspace: Handle child not being present in the window slots array Adding children to the WorkspaceLayout without calling addPreview() is not supported, so let's log an error in case that happened. We also have to allocate that child an empty ClutterActorBox, otherwise Clutter will complain loudly. Part-of: --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index ee6e198b1..ab49e6412 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -595,8 +595,11 @@ var WorkspaceLayout = GObject.registerClass({ // The fifth element in the slot array is the WindowPreview const index = this._windowSlots.findIndex(s => s[4] === child); - if (index === -1) + if (index === -1) { + log('Couldn\'t find child %s in window slots'.format(child)); + child.allocate(childBox); continue; + } const [x, y, width, height] = this._windowSlots[index]; const windowInfo = this._windows.get(child);